# -*- coding: utf-8 -*-
"""
author:码同学 极光
date:2023-01-07
desc: 
sample: 
"""
#普通参数
def do_somethings1(a1,a2):
    print(f"a1={a1},a2={a2}, {type(a1)}, {type(a2)}")

# do_somethings1(1,2)
# do_somethings1("1","2")
# do_somethings1("zhangsan",["abc","abc"])
# do_somethings1("zhangsan",{"abc","abc"})
# do_somethings1(a1="test1",a2="test2")  #关键词参数
# do_somethings1(a2="testa2",a1="testa1")

#缺省参数
def do_somethings2(a1=1,a2=2):
    print(f"a1={a1},a2={a2}, {type(a1)}, {type(a2)}")
# do_somethings2(1,2)
# do_somethings2(1)
# do_somethings2()
# do_somethings2("1","2")
# do_somethings2("zhangsan",["abc","abc"])
# do_somethings2("zhangsan",{"abc","abc"})
# do_somethings2(a1="test1",a2="test2")  #关键词参数
# do_somethings2(a2="testa2",a1="testa1")

#不定长参数
def do_something3(*args,a1):
    print(f"type_a {type(a1)}, type_args {type(args)} a1={a1}, a2={args}")
do_something3(2,1121,1212,a1=1212)
# do_something3(1,1,2,"test")
# do_something3(1,(1,2,"test"))
# info = {
#     "age":18,
#     "status":True,
#     "name":"极光"
# }
# do_something3(1,info)

#关键字参数
def do_something4(a1, **kwargs):
    print(f"type_a {type(a1)}, kwargs {type(kwargs)} a1={a1}, kwargs={kwargs}")
# do_something4(1)
# do_something4(a2="test111",a1="test")
# do_something4(a1=2,a2=3,x=2,a3="111",a4="11212")
# info = {
#     "age":18,
#     "status":True,
#     "name":"极光"
# }
# do_something4(1,**info)

#万能
def do_something5(*args,**kwargs):
    print(f"args {type(args)}, kwargs {type(kwargs)} args={args}, kwargs={kwargs}")

# do_something5()
# do_something5(11,22)
# do_something5(k1=11,k2=22)
# do_something5(11,22,k1=11)
# do_something5((11,22),[1,2],k1=11,k2=22)



def do_something7(*args, step1=" ", end="\n"):
    print(args,step1,end)

do_something7(1,2)


def do_something8(step1 =" ", *args, end="\n"):
    print(args,step1,end)

do_something8(1,2)

